﻿// See https://aka.ms/new-console-template for more information
using ConsoleAppNetworkTestAndToEmail;

Console.WriteLine("检测主机是否可以访问");

//string mailFrom = "whlcac1992@163.com";
//string mailTo = "whlcac1992@163.com";
//string mailAccount = "whlcac1992@163.com";
//string password = "163emailqx";//客户端授权码
//string title = "测试发送标题";
//string content = "测试发送内容" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//SendEmailTool.TestSmtpClient(mailFrom, mailTo, title, content, mailAccount, password,ServerType.SERVER_163_COM);


//string mailFrom = "1071768101@qq.com";
//string mailTo = "1071768101@qq.com";
//string mailAccount = "1071768101@qq.com";
//string password = "kyxghsceemujbegj";//客户端授权码
//string title = "测试发送标题";
//string content = "测试发送内容" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//SendEmailTool.TestSmtpClient(mailFrom, mailTo, title, content, mailAccount, password, ServerType.SERVER_qq_COM);


//检隔多少秒检测地址一次
int testing_seconds = 0;
if (!int.TryParse(MyConfigReader.GetConfigValue("testing_seconds"), out testing_seconds))
{
    testing_seconds = 30;
}

while (true)
{
    TestingBusiness.PingHostList();
    Thread.Sleep(testing_seconds * 1000);
    Console.WriteLine("线程休眠时间秒="+ testing_seconds);
}


//无限期等待
Task.Delay(-1).Wait(-1);